import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Fullfileop
{
	public static void main(String[] args) throws MalformedURLException, UnsupportedEncodingException, IOException
	{
            BufferedReader reader = null;
            
        try {
           
            URL url=null;
                
               // url = new URL("http://ichart.yahoo.com/table.csv?s=GOOG&d=0&e=31&f=2010&a=0&b=1&c=2009&g=d&ignore=.csv ");    
                File f = new File("D:/project/src/java/quotes/table.csv");
              //  url = new URL("table.csv");
                reader = new BufferedReader(new FileReader(f));
               // reader = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8"));
                String s1,a=null,b=null,c=null,d=null,e=null;
                int k=0,j;
                Long l;
                Date dt=null;
                
               DateFormat df;
               df=new SimpleDateFormat("yyyy-mm-dd");
                        
//		System.out.println(bf.readLine());
               System.out.print("[");
            
                while((s1=reader.readLine())!=null)
                       {
                    
                             if(k==0){
                        k=1;
                        
                        continue;
                    }
                        
                        String[] tokens = s1.split(",");
                        
                        
                        for(int i=0;i<tokens.length;i++)
                        {
                            if(i==0){
                       
                            //System.out.print(tokens[i]);
                           dt=(Date)df.parse(tokens[i]);
                       
                               
                              l=dt.getTime();
                            //    System.out.print("[");
                              //  System.out.print(l+",");
                               a=l.toString();
                              //  continue;
                            }
                            if(i==1)
                                b=tokens[i];
                            if(i==2)
                                c=tokens[i];
                            if(i==3)
                                d=tokens[i];
                            if(i==4)
                                e=tokens[i];
                            
                            //    System.out.print(tokens[i]);
                          //  if(i==4){
                               // System.out.println(tokens[i]+"],");
                                
                            }
                       
                            System.out.println("["+a+","+b+","+c+","+d+","+e+"],");    
                        }
                System.out.print("["+a+","+b+","+c+","+d+","+e+"]");
          
                }
        catch (Exception ex) {
            Logger.getLogger(Fullfileop.class.getName()).log(Level.SEVERE, null, ex);
        }     
                
                System.out.print("]");
        try {
            reader.close();
        } catch (IOException ex) {
            Logger.getLogger(Fullfileop.class.getName()).log(Level.SEVERE, null, ex);
        }
                
}       
		
}
